Rendering
Use render passes to define the rendering of nodes in your Kanzi application. For example, in a render pass you define which Camera that render pass uses for rendering, what nodes it renders, and settings for the color and depth buffer use. See Render passes.
You can use multiple render passes to apply post-processing effects. See Post-processing effects.
Kanzi contains filters and object sources you can use to select and refine the collection of nodes you send to a render pass for rendering. Doing so you can precisely define the order of how Kanzi renders the content of the Scene or Viewport 2D node. See Filters and Using object sources.
Render passes
Each Scene node has the Render Pass property that determines which render pass Kanzi uses for rendering that Scene node. When you create a Scene node, it uses the DefaultRenderPass to render its content.
You can define how you want Kanzi to render the nodes in your project by creating render passes, setting the hierarchy and order of the render passes, and setting different properties in the render passes.
Create a nested hierarchy of render passes, and set the Render Pass property of a Scene node to a Group Render Pass at the topmost level in your render pass tree. Kanzi Studio executes the render passes in the Library > Rendering > Render Passes from top to bottom. Each render pass applies its settings and renders its children.
These render passes are available in Kanzi Studio:
- Group Render Pass allows you to collect render passes so that you can refer to a single render pass in your Scene or Viewport 2D node.
You do not need a Group Render Pass if your topmost render pass can have all your other render passes as its children.
- Clear Render Pass clears some or all of the buffers of the current render context.
You can set the values to which Kanzi clears color, depth, and stencil buffer.
- Pipeline State Render Pass allows you to set: Kanzi uses the properties set in a Pipeline State Render Pass to render its child render passes, not its sibling render passes.
If you do not set a property in a Pipeline State Render Pass, Kanzi uses the value for the property set in the nearest parent Pipeline State Render Pass. If there is no parent render pass, Kanzi uses the default value.
- Draw Objects Render Pass allows you to use a specific camera to render a specific object source. See Using object sources and Filters.
By default Draw Objects Render Pass uses the default Camera node to render all nodes in the scene graph of the Scene node.
Set all rendering parameters for a Draw Objects Render Pass in its parent Pipeline State Render Pass.
- Blit Render Pass blits one or more render passes or textures on the screen using a specific material. See Rendering multiple render passes or textures.
The area Kanzi uses to render the textures is the same as the current render context area.
- Composition Target Render Pass renders itself to a composition target.
When you render content to a composition target, Kanzi creates from the content a texture. You can use another render pass to draw this texture to the screen or to another composition target using a specific material.
You can set the composition target manually. If you do not set the composition target, Kanzi creates one automatically.
A Blit Render Pass can use the composition target a Composition Target Render Pass renders itself to.
- Default Render Pass creates the render passes and filters you need to first render opaque nodes and then transparent nodes.
Use the Default Render Pass as a starting point for your render pass tree. See Using the Default Render Pass.
- Render to Texture Pass creates the render passes and texture you need to render to a texture. See Rendering to texture.
Post-processing effects
Use multiple render passes to apply post-processing effects.
To apply post-processing effects:
- Create a material which supports the post-processing effect that you want to apply.
- Create the hierarchy of render passes which creates the post-processing effect you want to apply.
For examples of how to apply post-processing effects, see Tutorial: Create a Gaussian blur effect and Tutorial: Create a bloom effect.
Using render passes in the API
For details, see the RenderPass
class in the API reference.
See also
Rendering best practices
Using Kanzi Studio render pass templates
Rendering multiple render passes or textures
Using object sources
Filters
Tutorial: Create a Gaussian blur effect
Tutorial: Apply a stencil to 3D content
Open topic with navigation